package com.ylfstu.set_;

public class HashSetStructure {

    public static void main(String[] args) {
        //模拟HashMap底层，HashSet底层就是HashMap

        //1.创建一个数组，数组的类型是Node[]
        Node[] table = new Node[16];
        //2.创建结点
        Node john = new Node("john", null);
        table[2] = john;
        Node jack = new Node("jack", null);
        john.next = jack;
        Node rose = new Node("rose", null);
        jack.next = rose;
        Node lucy = new Node("lucy", null);
        rose.next = lucy;
        System.out.println(table);


    }
}
class Node{
    Object item;//存放数据
    Node next; //指向下一个结点

    public Node(Object item, Node next) {
        this.item = item;
        this.next = next;
    }
}